*COMDECK COML
C================================================================COML
C     NXT=(I1-1)*2+NX
C     NYT=(J1-1)*2+NY
C     NZT=(K1-1)*2+NZ
C================================================================COML
      IMPLICIT NONE
      INTEGER NXT,NYT,NZT,N3,NLR,NDF,NBT
      INTEGER NSP,LNRK,LNRE,NIT,NCMP
      INTEGER NPAR,NPSP,LNOZ,NSIZE
      PARAMETER (NXT=58,NYT=67,NZT= 1)
      PARAMETER (NSP=15,LNRK= 3,LNRE=10,NIT=201,NCMP=3)
      PARAMETER (NPAR=15000,NPSP=2,LNOZ=2,NSIZE=100)
      PARAMETER (N3=NXT*NYT*NZT,NLR=NYT*NZT,NDF=NXT*NZT,NBT=NXT*NYT)
C================================================================COML
C
C     MAIN VARIABLES SAVED IN DUMP
C
C================================================================COML
C--------------------------------------- CONTROL PARAMETERS -----COML
C ----- Add ICONDP AND IEVAP IN THE COMMON, BY Y.P. WAN
      DOUBLE PRECISION ADC,BDC,TIME,TIMOVI,DTOLD
      INTEGER INCOMP,ISWIRL,ICYL,NODIFF,NLTE,ICONDP,IEVAP,NCYC,NMJ
      COMMON /CNTRL/ ADC,BDC,TIME,TIMOVI,DTOLD(N3),
     1     INCOMP,ISWIRL,ICYL,NODIFF,NLTE,ICONDP,IEVAP,NCYC,NMJ
C------------------------------------------- MESH VARIABLES -----COML
      DOUBLE PRECISION XL,YL,ZL,DX,DY,DZ,RDX,RDY,RDZ,XC,X,Y,Z,
     1     AREA,VOL,HRDXCR,HRDYCF,HRDZCT
      INTEGER I1,I2,J1,J2,K1,K2,IC1U,IC1V,IC1W,IC1,IC2,
     1     NX,NY,NZ,NXYT,NXYZT,IGRIDX,IGRIDY,IGRIDZ,NIT1,
     2     NXS,NXL,NYS,NYL,NZS,NZL,ICIN,ICOUT
      COMMON /GRID/ XL,YL,ZL,DX(N3),DY(N3),DZ(N3),
     1     RDX(N3),RDY(N3),RDZ(N3),XC(N3),X(0:NXT),Y(0:NYT),Z(0:NZT),
     2     AREA(N3),VOL(N3),HRDXCR(N3),HRDYCF(N3),HRDZCT(N3),
     3     I1,I2,J1,J2,K1,K2,IC1U,IC1V,IC1W,IC1,IC2,
     4     NX,NY,NZ,NXYT,NXYZT,IGRIDX,IGRIDY,IGRIDZ,NIT1,
     5     NXS,NXL,NYS,NYL,NZS,NZL,ICIN,ICOUT
C------------------------------------------------ R FACTORS -----COML
      DOUBLE PRECISION RC,RR,RF,RT,RRC
      COMMON /RFAC/ RC(N3),RR(N3),RF(N3),RT(N3),RRC(N3)
C------------------------------------------- MAIN VARIABLES -----COML
      DOUBLE PRECISION U,V,W,UN,VN,WN,RORU,RORV,RORW,
     1     ROE,ROEN,ROER,TEMP,ROEE,ROEEN,ROEER,TE,
     2     RO,RON,SPD,SPDR,SPDN
      COMMON /VEL/ U(N3),V(N3),W(N3),UN(N3),VN(N3),WN(N3),
     1     RORU(N3),RORV(N3),RORW(N3),
     2     ROE(N3),ROEN(N3),ROER(N3),TEMP(N3),
     3     ROEE(N3),ROEEN(N3),ROEER(N3),TE(N3),
     4     RO(N3),RON(N3),SPD(N3,NSP),SPDR(N3,NSP),SPDN(N3,NSP)
C-------------------------------------- BOUNDARY CONDITIONS -----COML
      DOUBLE PRECISION PBCL,PBCR,PBCD,PBCF,PBCB,PBCT,
     1     SDNL,SDNR,SDND,SDNF,SDNB,SDNT,
     2     EDENL,EDENR,EDEND,EDENF,EDENB,EDENT,
     3     TEMPL,TEMPR,TEMPD,TEMPF,TEMPB,TEMPT,
     4     EDEEL,EDEER,EDEED,EDEEF,EDEEB,EDEET,
     5     TEEL,TEER,TEED,TEEF,TEEB,TEET,
     6     PRESL,PRESR,PRESD,PRESF,PRESB,PREST,
     7     UVELL,UVELR,UVELD,UVELF,UVELB,UVELT,
     8     VVELL,VVELR,VVELD,VVELF,VVELB,VVELT,
     9     WVELL,WVELR,WVELD,WVELF,WVELB,WVELT,
     9     TKEL,TKER,TKED,TKEF,TKEB,TKET,
     1     EPSL,EPSR,EPSD,EPSF,EPSB,EPST
      INTEGER IPBC
      COMMON /BC/
     1     PBCL(NLR),PBCR(NLR),PBCD(NDF),PBCF(NDF),PBCB(NBT),PBCT(NBT),
     2     SDNL(NLR,NSP),SDNR(NLR,NSP),SDND(NDF,NSP),
     3     SDNF(NDF,NSP),SDNB(NBT,NSP),SDNT(NBT,NSP),
     4EDENL(NLR),EDENR(NLR),EDEND(NDF),EDENF(NDF),EDENB(NBT),EDENT(NBT),
     5TEMPL(NLR),TEMPR(NLR),TEMPD(NDF),TEMPF(NDF),TEMPB(NBT),TEMPT(NBT),
     6EDEEL(NLR),EDEER(NLR),EDEED(NDF),EDEEF(NDF),EDEEB(NBT),EDEET(NBT),
     7     TEEL(NLR),TEER(NLR),TEED(NDF),TEEF(NDF),TEEB(NBT),TEET(NBT),
     8PRESL(NLR),PRESR(NLR),PRESD(NDF),PRESF(NDF),PRESB(NBT),PREST(NBT),
     9UVELL(NLR),UVELR(NLR),UVELD(NDF),UVELF(NDF),UVELB(NBT),UVELT(NBT),
     9VVELL(NLR),VVELR(NLR),VVELD(NDF),VVELF(NDF),VVELB(NBT),VVELT(NBT),
     1WVELL(NLR),WVELR(NLR),WVELD(NDF),WVELF(NDF),WVELB(NBT),WVELT(NBT),
     2     TKEL(NLR),TKER(NLR),TKED(NDF),TKEF(NDF),TKEB(NBT),TKET(NBT),
     3     EPSL(NLR),EPSR(NLR),EPSD(NDF),EPSF(NDF),EPSB(NBT),EPST(NBT),
     4     IPBC
C------------------- PRESSURE, ACCELERATION, AND DIVERGENCE -----COML
      DOUBLE PRECISION P,PN,Q,QN,DIV,DIVOLD,DIVE,UDELR
      COMMON /PRESS/ P(N3),PN(N3),Q(N3),QN(N3),
     1     DIV(N3),DIVOLD(N3),DIVE(N3),UDELR(N3)
C------------------------------------------ STATE VARIABLES -----COML
      DOUBLE PRECISION MW,RMW,GAMMA,EK,HK,HTFORM,QOM
      INTEGER IELC,IGAS
      COMMON /THERPH/ MW(NSP),RMW(NSP),GAMMA(N3),EK(NIT,NSP),
     1     HK(NIT,NSP),HTFORM(NSP),QOM(NSP),IELC,IGAS(NSP)
C-------------------------- EQUILIBRIUM CHEMISTRY VARIABLES -----COML
      DOUBLE PRECISION OMGDOT
      COMMON /CHMSTR/ OMGDOT(N3,LNRE)
C--------------------------- VARIABLES IN TURBULENCE MODELS -----COML
      DOUBLE PRECISION ROTKER,TKE,TKEN,ROEPSR,EPS,EPSN,SGSL,WSDT
      COMMON /TURB/ ROTKER(N3),TKE(N3),TKEN(N3),
     1     ROEPSR(N3),EPS(N3),EPSN(N3),SGSL(N3),WSDT(N3)
C------------------------------------------------ PARTICLES -----COML
      DOUBLE PRECISION RANB,RANS,TM1INJ,TM2INJ,
     1     RADP,PARTN,PMSP,PMASS,AREAP,XP,YP,ZP,
     2     UP,VP,WP,UTRB,VTRB,WTRB,TURBT,TP,EP,DTPDEP,
     3     TMM,TML,RPSPHS,RPSPHL,EPM,EPL,EMSSP
      INTEGER NP,ICP,ICNOZ,MTYPE
      COMMON /PART/ RANB,RANS,TM1INJ(LNOZ),TM2INJ(LNOZ),RADP(NPAR),
     1     PARTN(NPAR),PMSP(NPAR,NPSP),PMASS(NPAR),AREAP(NPAR),
     2     XP(NPAR),YP(NPAR),ZP(NPAR),UP(NPAR),VP(NPAR),WP(NPAR),
     3     UTRB(NPAR),VTRB(NPAR),WTRB(NPAR),TURBT(NPAR),
     4     TP(NPAR),EP(NPAR),DTPDEP(NPAR),TMM(NPAR),TML(NPAR),
     5     RPSPHS(NPAR),RPSPHL(NPAR),EPM(NPAR),EPL(NPAR),EMSSP(NPAR),
     6     NP,ICP(NPAR),ICNOZ(LNOZ),MTYPE(NPAR)
C------------------------------------- TRANSPORT PROPERTIES -----COML
      DOUBLE PRECISION VISC,COND,CONDE,RADLSS,VIST,DCOEF
      COMMON /XPTY/ VISC(N3),COND(N3),CONDE(N3),RADLSS(N3),VIST(N3),
     1     DCOEF(N3,NSP)
C================================================================COML
C
C     VARIABLES DEFINED IN INPUT FILE, BLOCK DATA, AND DUMMY ARRAYS
C     ARE NOT SAVED IN DUMP
C
C================================================================COML
C
C     DUMMY ARRAYS
C
C================================================================COML
C--------------------------------------------- DUMMY ARRAYS -----COML
      DOUBLE PRECISION WT,DISS,FL,FLS,FLH,FLQ,FLA,FLAS,FLAQ,FLSQ
      COMMON /DUMMY/ WT(N3),DISS(N3),FL(N3),FLS(N3),FLH(N3),FLQ(N3),
     1     FLA(N3),FLAS(N3),FLAQ(N3),FLSQ(N3)
C-------------------- ARRAYS FOR SOLVING MOMENTUM EQUATIONS -----COML
      DOUBLE PRECISION RORUU,RORUV,RORUW,RORVU,RORVV,
     1     RORVW,RORWU,RORWV,RORWW,
     1     SRXX,SRYY,SRZZ,SRXY,SRYZ,SRXZ
      COMMON /MOMTM/ RORUU(N3),RORUV(N3),RORUW(N3),RORVU(N3),
     1     RORVV(N3),RORVW(N3),RORWU(N3),RORWV(N3),RORWW(N3),
     2     SRXX(N3),SRYY(N3),SRZZ(N3),SRXY(N3),SRYZ(N3),SRXZ(N3)
C-------------------- ARRAYS FOR SOLVING PARTICLE EQUATIONS -----COML
      DOUBLE PRECISION RELVEL,CD,HTCO,TSCALE,DMPTC
      INTEGER IBOIL
      COMMON /PATCL/ RELVEL(NPAR),CD(NPAR),HTCO(NPAR),TSCALE(NPAR),
     1               DMPTC(NPAR),IBOIL(NPAR)
C================================================================COML
C
C     VARIABLES DEFINED IN BLOCK DATA HOT
C
C================================================================COML
C--------------------------------------- PHYSICAL CONSTANTS -----COML
      DOUBLE PRECISION PI,PIO2,PI2,PI4,PI4O3,PIO180,
     1     RGAS,AVOGAD,ELECHG,VISRAT,ERGCAL,STEBOL,BOLTZ
      COMMON /PHYSIC/ PI,PIO2,PI2,PI4,PI4O3,PIO180,
     1     RGAS,AVOGAD,ELECHG,VISRAT,ERGCAL,STEBOL,BOLTZ
C-------------------------------- OTHER PHYSICAL PARAMETERS -----COML
      DOUBLE PRECISION TEMPMX,GX,GY,GZ,PAMB,TEMAMB,ETA0,
     1     PRL,RPRT,RSCT,CPS,P1ATM
      COMMON /CONST/ TEMPMX,GX,GY,GZ,PAMB,TEMAMB,ETA0,
     1     PRL,RPRT,RSCT,CPS,P1ATM
C---------------------- CONSTANTS USED IN TURBULENCE MODELS -----COML
      DOUBLE PRECISION REYC,CE1,CE2,CE3,CES,CMU,RPRE,SGSA,SGSD,
     1     CE2CR,CMUCOR,AKEML1,AKEML2
      COMMON /TURBH/ REYC,CE1,CE2,CE3,CES,CMU,RPRE,SGSA,SGSD,
     1     CE2CR,CMUCOR,AKEML1,AKEML2
C---------------------- CONTROL CONSTANTS USED IN CHEMISTRY -----COML
      DOUBLE PRECISION TCHEMI,EPSCHM,OMGCHM,OMGCM2
      COMMON /CHCON/ TCHEMI,EPSCHM,OMGCHM,OMGCM2
C-------- NUMBER OF MOLECULES FOR HETEROGENEOUS EQUILIBRIUM -----COML
      INTEGER NGAS,NCNDNS
      COMMON /HETEQ/ NGAS,NCNDNS
C------------------------------------ EQUILIBRIUM CHEMISTRY -----COML
      DOUBLE PRECISION CH4I1,CH4I2
      COMMON /ECHEMI/ CH4I1,CH4I2
C-------------- ACCELERATED EQUILIBRIUM CHEMISTRY VARIABLES -----COML
      DOUBLE PRECISION FRAC
      INTEGER NCMAX,MINVRT
      COMMON /EQCHSS/ FRAC,NCMAX,MINVRT
C----------------- SAFETY FACTORS USED IN TIME STEP CONTROL -----COML
      DOUBLE PRECISION SAFEDT,SAFDTD,DTGROW
      COMMON /SAFETY/ SAFEDT,SAFDTD,DTGROW
C-------------------------------------------------- NUMBERS -----COML
      DOUBLE PRECISION SMALL,LARGE,ZERO,ONE,TWO,THREE,FOUR,
     1     FIVE,SIX,SEVEN,EIGHT,NINE,HALF,PNTHRE,PNTSIX,PNTNIN,
     2     ONEO3,TWOO3,FOURO3,FIVO3,THRHAF,FIVHAF,
     3     TEN,TENTH,HUNDRD,HUNDTH,THOUSD,THOUTH,
     4     TWENTY
      COMMON /NUMBER/ SMALL,LARGE,ZERO,ONE,TWO,THREE,FOUR,
     1     FIVE,SIX,SEVEN,EIGHT,NINE,HALF,PNTHRE,PNTSIX,PNTNIN,
     2     ONEO3,TWOO3,FOURO3,FIVO3,THRHAF,FIVHAF,
     3     TEN,TENTH,HUNDRD,HUNDTH,THOUSD,THOUTH,
     4     TWENTY
C----------------------------------- MATHEMATICAL FUNCTIONS -----COML
      DOUBLE PRECISION RERF
      COMMON /FUNC/ RERF(21)
C--------------------------------- INPUT AND OUTPUT CONTROL -----COML
      INTEGER IDUMP,NFDMP,NFRST,NFINP,NFOUT
      COMMON /IO/ IDUMP,NFDMP,NFRST,NFINP,NFOUT
C================================================================COML
C
C     VARIABLES DEFINED IN INPUT FILE AND NOT SAVED IN DUMP
C
C================================================================COML
C-------------------------------- PRESSURE AND ACCELERATION -----COML
      DOUBLE PRECISION PGS,RPGS2,DAMP,THETA,RELAX,PQDIF,PREF
      INTEGER MACCEL
      COMMON /ACCEL/ PGS,RPGS2,DAMP,THETA,RELAX,PQDIF,PREF,MACCEL
C---------------------------------- RUN-TIME OPTION CONTROL -----COML
      DOUBLE PRECISION DT,DTJUMP,DTI,DTMAX,TMAX,TIMPTL
      INTEGER LDT,JUMP,NMAX
      COMMON /NCNT/ DT(N3),DTJUMP,DTI,DTMAX,TMAX,TIMPTL,LDT,JUMP,NMAX
C ---------- FOR THE INPUT OF OPERATING CONDITIONS, BY Y.P. WAN -COML
      DOUBLE PRECISION CURCY,VOLTG,EFFCY,FLRT1,FLRT2,PWVEL,PWTEP,
     1                 SWIRN
      COMMON /OPERATE/CURCY,VOLTG,EFFCY,FLRT1,FLRT2,PWVEL,PWTEP,SWIRN
C------------------------------ KINETIC CHEMISTRY VARIABLES -----COML
      DOUBLE PRECISION AE,BE,CHAEFF,AKS,BKS,CKS,DKS,EKS,ZETAF,CF,EF,
     1     QR,FBMAM,FAM,FBM,FEK,FRK,TFLAGK,TCUTL,TCUTH
      INTEGER NRK,NELEM,AM,BM,CM
      COMMON /KICHEM/ AE(NSP,LNRK),BE(NSP,LNRK),CHAEFF(NSP,LNRK),
     1     AKS(LNRK),BKS(LNRK),CKS(LNRK),DKS(LNRK),EKS(LNRK),
     2     ZETAF(LNRK),CF(LNRK),EF(LNRK),QR(LNRK),
     3     FBMAM(NSP,LNRK),FAM(NSP,LNRK),FBM(NSP,LNRK),
     4     FEK(LNRK),FRK(LNRK),TFLAGK(LNRK),TCUTL(LNRK),TCUTH(LNRK),
     5     NRK,NELEM(LNRK),AM(NSP,LNRK),BM(NSP,LNRK),CM(NSP,LNRK)
C--------- FAST KINETIC AND EQUILIBRIUM CHEMISTRY VARIABLES -----COML
      DOUBLE PRECISION AS,BS,CS,DS,ES,FBNAN,QEQ,TCUTEL,TCUTEH,
     1     CFE,EFE,ZETAFE,FEE,FRE,TFLAGE
      INTEGER NRE,NLM,AN,BN,CN
      COMMON /EQCHEM/ AS(LNRE),BS(LNRE),CS(LNRE),DS(LNRE),ES(LNRE),
     1     FBNAN(NSP,LNRE),QEQ(LNRE),TCUTEL(LNRE),TCUTEH(LNRE),
     2     CFE(LNRE),EFE(LNRE),ZETAFE(LNRE),
     3     FEE(LNRE),FRE(LNRE),TFLAGE(LNRE),
     4     NRE,NLM(LNRE),AN(NSP,LNRE),BN(NSP,LNRE),CN(NSP,LNRE)
C---------------------------------------- TURBULENCE MODELS -----COML
      INTEGER ITURB,KECOR,LWALL
      COMMON /TURBR/ ITURB,KECOR,LWALL
C------------------------------------ ARRAYS FOR PROPERTIES -----COML
      DOUBLE PRECISION VIS,CND,CNDE,SSUBR,DCOFF
      COMMON /PROP/ VIS(NIT,NCMP),CND(NIT,NCMP),CNDE(NIT,NCMP),
     1     SSUBR(NIT,NCMP),DCOFF(NIT,NCMP)
C---------------------------- PARTICLE INJECTION PARAMETERS -----COML
      DOUBLE PRECISION XINJ,YINJ,ZINJ,ANOZ,T1INJ,
     1     CONE,TILTZ,TILTX,EAVEC,ENVEC,EOVEC,
     2     TSPMAS,PMINJ,TPINJ,VELINJ,VDISP,PYINJ,PXINJ,
     3     RPMIN,RPMAX,PSZDIS,PSZINT,PSZDEL,
     4     CARRYG,CRGAS,CRMOMX,CRMOMY,CRMOMZ,CRENGY
      INTEGER IPTCL,I3DP2D,NUMNOZ,ICARRY,NPSDIS
      COMMON /NOZZLE/
     1     XINJ(LNOZ),YINJ(LNOZ),ZINJ(LNOZ),ANOZ(LNOZ),T1INJ(LNOZ),
     2     CONE(LNOZ),TILTZ(LNOZ),TILTX(LNOZ),
     3     EAVEC(LNOZ,3),ENVEC(LNOZ,3),EOVEC(LNOZ,3),
     4     TSPMAS(LNOZ),PMINJ(LNOZ),TPINJ(LNOZ),
     5     VELINJ(LNOZ),VDISP(LNOZ),
     6     PYINJ(LNOZ,NPSP),PXINJ(LNOZ,NPSP),
     7     RPMIN(LNOZ),RPMAX(LNOZ),PSZDIS(NSIZE,LNOZ),
     8     PSZINT(NSIZE+1,LNOZ),PSZDEL(LNOZ),
     9     CARRYG(LNOZ,NSP),CRGAS(LNOZ),
     9     CRMOMX(LNOZ),CRMOMY(LNOZ),CRMOMZ(LNOZ),CRENGY(LNOZ),
     1     IPTCL,I3DP2D,NUMNOZ,ICARRY,NPSDIS(LNOZ)
C----------------------------- PARTICLE MATERIAL PROPERTIES -----COML
      DOUBLE PRECISION ROPI,TMMI,TMLI,HLTNT,PSPHS,PSPHL,EMSSPI
      COMMON /MPTYP/ ROPI(NPSP),TMMI(NPSP),TMLI(NPSP),HLTNT(NPSP),
     1     PSPHS(NPSP),PSPHL(NPSP),EMSSPI(NPSP)
C================================================================COML
C
C     FREQUENTLY USED VARIABLES
C
C================================================================COML
      INTEGER I,J,K,ICJ,ICK,IC,ISP,IT,
     1     ICL,ICR,ICD,ICF,ICB,ICT,ICLR,ICDF,ICBT
      INTEGER IP,IPSP,NPN
C================================================================COML
C SOME NEW PARAMETERS ADDED BY Y.P. WAN 4-22-98
C     
C ---- PARAMETERS FOR VOLTAGE FLUCTUATING CONTROL
      INTEGER IFLUCT,IPOST
	  COMMON /FLUCT/IFLUCT,IPOST
c     EQUIVALENCE (RO(1),RON(1)),(ROE(1),ROER(1)),
c    1     (U(1),RORU(1)),(V(1),RORV(1)),(W(1),RORW(1)),
c    2     (ROUC(1),RORUU(1),RORVU(1),RORWU(1),SRXX(1)),
c    3     (ROVC(1),RORUV(1),RORVV(1),RORWV(1),SRYY(1)),
c    4     (ROWC(1),RORUW(1),RORVW(1),RORWW(1),SRZZ(1)),
c    5     (ROUU(1),ROVU(1),ROWU(1)),
c    6     (ROUV(1),ROVV(1),ROWV(1)),
c    7     (ROUW(1),ROVW(1),ROWW(1))
c     EQUIVALENCE (dummy commonblock -- diss,wt,fl,flh etc.)
c     EQUIVALENCE
c    1 (SPDR(1,1),SPD(1,1)),(SPDR(1,2),SPD(1,2)),(SPDR(1,3),SPD(1,3))
C    2 ,(SPDR(1,4),SPD(1,4)),(SPDR(1,5),SPD(1,5)),(SPDR(1,6),SPD(1,6))
C    3 ,(SPDR(1,7),SPD(1,7)),(SPDR(1,8),SPD(1,8)),(SPDR(1,9),SPD(1,9))
C    4 ,(SPDR(1,10),SPD(1,10)),(SPDR(1,11),SPD(1,11))
C    5 ,(SPDR(1,12),SPD(1,12)),(SPDR(1,13),SPD(1,13))
C    6 ,(SPDR(1,14),SPD(1,14)),(SPDR(1,15),SPD(1,15))
c     EQUIVALENCE (TKE(1),ROTKER(1)),(EPS(1),ROEPSR(1))
c    1 ,(EPS(1),SGSL(1))
C================================================================COML
c     temporary stuff
c     for wall function at curved bdry
c-----
c     integer nwf
c     parameter (nwf=29)
c     double precision volwf,depl,awf,apwf,twfx,twfy,tcmx,tcmy
c     integer iwf,icase
c     common /wfn/ volwf(nwf),depl(nwf),awf(nwf),apwf(nwf),
c    1     twfy(nwf),twfx(nwf),tcmx(nwf),tcmy(nwf),iwf(nwf),icase
C================================================================COML
